<template>
<div>
  <detail-banner :sightName='sightName' :bannerImg='bannerImg' :gallaryImgs='gallaryImgs'></detail-banner>
  <detail-header></detail-header>
  <div class="content"><detail-list :list='list'></detail-list></div>
  <div class="content"></div>
  </div>
</template>

<script>
import DetailBanner from './components/banner.vue'
import DetailHeader from './components/Header.vue'
import DetailList from './components/list.vue'
import axios from 'axios'
export default {
  name: 'Detail',
  components: {
    DetailBanner,
    DetailHeader,
    DetailList
  },
  data () {
    return {
      sightName: '',
      bannerImg: '',
      gallaryImgs: [],
      categoryList: [],
      list: [{tittle: '成人票',
        children: [{
          tittle: '成人三馆联票',
          children: [{
            tittle: '成人三馆联票 - 某一连锁店销售'
          }]
        }, {
          tittle: '成人五馆联票'
        }]
      },
      {tittle: '学生票'},
      {tittle: '儿童票'}, {tittle: '特惠票'}]
    }
  },
  methods: {
    getDdetailInfo () {
      axios.get('/api/detail.json?id=' + this.$route.params.id).then(this.handleGetDataSucc)
    },
    handleGetDataSucc (res) {
      res = res.data
      if (res.ret && res.data) {
        const data = res.data
        this.sightName = data.sightName
        this.bannerImg = data.bannerImg
        this.gallaryImgs = data.gallaryImgs
        this.categoryList = data.categoryList
      }
    }
  },
  mounted () {
    this.getDdetailInfo()
  }
}
</script>

<style scoped>
  .content {
    height: 50rem;
}
</style>
